package com.daiqile.rxjava;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import com.panes.shapelocker.view.ShapeLocker;

import java.util.List;

public class Hands extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_hands);
        final ShapeLocker shapeLocker = (ShapeLocker)findViewById(R.id.sl);
        shapeLocker.loadLightTheme();


        shapeLocker.setOnPatternListener(new ShapeLocker.OnPatternListener() {
            @Override
            public void onPatternStart() {
                Toast.makeText(Hands.this,"start",Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onPatternCleared() {
                Toast.makeText(Hands.this,"cleared",Toast.LENGTH_SHORT).show();

            }

            @Override
            public void onPatternCellAdded(List<ShapeLocker.Cell> list) {
                Toast.makeText(Hands.this,"Added",Toast.LENGTH_SHORT).show();

            }

            @Override
            public void onPatternDetected(List<ShapeLocker.Cell> list) {
                Toast.makeText(Hands.this,"Detected",Toast.LENGTH_SHORT).show();
                Intent intent = new Intent(Hands.this,HandsCheck.class);
                startActivity(intent);


            }
        });

    }
}
